Skip to content

Commit 48822ff

Browse files
authored
Merge branch 'dev' into dependabot/nuget/System.Data.OleDb-9.0.3
2 parents 02662a3 + ff7274f commit 48822ff

File tree

591 files changed

+27889
-9877
lines changed

Some content is hidden

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

591 files changed

+27889
-9877
lines changed

.github/ISSUE_TEMPLATE/bug-report.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ body:
1616
I have checked that this issue has not already been reported.
1717
- label: >
1818
I am using the latest version of Flow Launcher.
19+
- label: >
20+
I am using the prerelease version of Flow Launcher.
1921
2022
- type: textarea
2123
attributes:

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ ssh
44
ubuntu
55
runcount
66
Firefox
7-
Português
8-
Português (Brasil)
7+
workaround

.github/actions/spelling/expect.txt

Lines changed: 7 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,20 @@ 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
106+
CJK

.github/actions/spelling/patterns.txt

Lines changed: 22 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,23 @@
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
137+
\bXiao\s*He\b
138+
\bZi\s*Ran\s*Ma\b
139+
\bWei\s*Ruan\b
140+
\bZhi\s*Neng\s*ABC\b
141+
\bZi\s*Guang\s*Pin\s*Yin\b
142+
\bPin\s*Yin\s*Jia\s*Jia\b
143+
\bXing\s*Kong\s*Jian\s*Dao\b
144+
\bDa\s*Niu\b
145+
\bXiao\s*Lang\b

.github/update_release_pr.py

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
from os import getenv
2+
from typing import Optional
3+
4+
import requests
5+
6+
7+
def get_github_prs(token: str, owner: str, repo: str, label: str = "", state: str = "all") -> list[dict]:
8+
"""
9+
Fetches pull requests from a GitHub repository that match a given label and state.
10+
11+
Args:
12+
token (str): GitHub token.
13+
owner (str): The owner of the repository.
14+
repo (str): The name of the repository.
15+
label (str): The label name. Filter is not applied when empty string.
16+
state (str): State of PR, e.g. open, closed, all
17+
18+
Returns:
19+
list: A list of dictionaries, where each dictionary represents a pull request.
20+
Returns an empty list if no PRs are found or an error occurs.
21+
"""
22+
headers = {
23+
"Authorization": f"token {token}",
24+
"Accept": "application/vnd.github.v3+json",
25+
}
26+
27+
# This endpoint allows filtering by label(and milestone). A PR in GH's perspective is a type of issue.
28+
prs_url = f"https://api.github.com/repos/{owner}/{repo}/issues"
29+
params = {
30+
"state": state,
31+
"labels": label,
32+
"per_page": 100,
33+
}
34+
35+
all_prs = []
36+
page = 1
37+
while True:
38+
try:
39+
params["page"] = page
40+
response = requests.get(prs_url, headers=headers, params=params)
41+
response.raise_for_status() # Raise an exception for HTTP errors
42+
prs = response.json()
43+
44+
if not prs:
45+
break # No more PRs to fetch
46+
47+
# Check for pr key since we are using issues endpoint instead.
48+
all_prs.extend([item for item in prs if "pull_request" in item])
49+
page += 1
50+
51+
except requests.exceptions.RequestException as e:
52+
print(f"Error fetching pull requests: {e}")
53+
exit(1)
54+
55+
return all_prs
56+
57+
58+
def get_prs(
59+
pull_request_items: list[dict], label: str = "", state: str = "all", milestone_title: Optional[str] = None
60+
) -> list[dict]:
61+
"""
62+
Returns a list of pull requests after applying the label and state filters.
63+
64+
Args:
65+
pull_request_items (list[dict]): List of PR items.
66+
label (str): The label name. Filter is not applied when empty string.
67+
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.
70+
71+
Returns:
72+
list: A list of dictionaries, where each dictionary represents a pull request.
73+
Returns an empty list if no PRs are found.
74+
"""
75+
pr_list = []
76+
count = 0
77+
for pr in pull_request_items:
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
83+
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 {milestone_title if milestone_title else "any"}"
93+
)
94+
95+
return pr_list
96+
97+
98+
def get_prs_assignees(pull_request_items: list[dict]) -> list[str]:
99+
"""
100+
Returns a list of pull request assignees, excludes jjw24.
101+
102+
Args:
103+
pull_request_items (list[dict]): List of PR items to get the assignees from.
104+
105+
Returns:
106+
list: A list of strs, where each string is an assignee name. List is not distinct, so can contain
107+
duplicate names.
108+
Returns an empty list if none are found.
109+
"""
110+
assignee_list = []
111+
for pr in pull_request_items:
112+
[assignee_list.append(assignee["login"]) for assignee in pr["assignees"] if assignee["login"] != "jjw24"]
113+
114+
print(f"Found {len(assignee_list)} assignees")
115+
116+
return assignee_list
117+
118+
119+
def get_pr_descriptions(pull_request_items: list[dict]) -> str:
120+
"""
121+
Returns the concatenated string of pr title and number in the format of
122+
'- PR title 1 #3651
123+
- PR title 2 #3652
124+
- PR title 3 #3653
125+
'
126+
127+
Args:
128+
pull_request_items (list[dict]): List of PR items.
129+
130+
Returns:
131+
str: a string of PR titles and numbers
132+
"""
133+
description_content = ""
134+
for pr in pull_request_items:
135+
description_content += f"- {pr['title']} #{pr['number']}\n"
136+
137+
return description_content
138+
139+
140+
def update_pull_request_description(token: str, owner: str, repo: str, pr_number: int, new_description: str) -> None:
141+
"""
142+
Updates the description (body) of a GitHub Pull Request.
143+
144+
Args:
145+
token (str): Token.
146+
owner (str): The owner of the repository.
147+
repo (str): The name of the repository.
148+
pr_number (int): The number of the pull request to update.
149+
new_description (str): The new content for the PR's description.
150+
151+
Returns:
152+
dict or None: The updated PR object (as a dictionary) if successful,
153+
None otherwise.
154+
"""
155+
headers = {
156+
"Authorization": f"token {token}",
157+
"Accept": "application/vnd.github.v3+json",
158+
"Content-Type": "application/json",
159+
}
160+
161+
url = f"https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}"
162+
163+
payload = {"body": new_description}
164+
165+
print(f"Attempting to update PR #{pr_number} in {owner}/{repo}...")
166+
print(f"URL: {url}")
167+
168+
try:
169+
response = None
170+
response = requests.patch(url, headers=headers, json=payload)
171+
response.raise_for_status()
172+
173+
print(f"Successfully updated PR #{pr_number}.")
174+
175+
except requests.exceptions.RequestException as e:
176+
print(f"Error updating pull request #{pr_number}: {e}")
177+
if response is not None:
178+
print(f"Response status code: {response.status_code}")
179+
print(f"Response text: {response.text}")
180+
exit(1)
181+
182+
183+
if __name__ == "__main__":
184+
github_token = getenv("GITHUB_TOKEN")
185+
186+
if not github_token:
187+
print("Error: GITHUB_TOKEN environment variable not set.")
188+
exit(1)
189+
190+
repository_owner = "flow-launcher"
191+
repository_name = "flow.launcher"
192+
state = "all"
193+
194+
print(f"Fetching {state} PRs for {repository_owner}/{repository_name} ...")
195+
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)
198+
199+
if not all_pull_requests:
200+
print("No pull requests found")
201+
exit(1)
202+
203+
print(f"\nFound total of {len(all_pull_requests)} pull requests")
204+
205+
release_pr = get_prs(all_pull_requests, "release", "open")
206+
207+
if len(release_pr) != 1:
208+
print(f"Unable to find the exact release PR. Returned result: {release_pr}")
209+
exit(1)
210+
211+
print(f"Found release PR: {release_pr[0]['title']}")
212+
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")
226+
227+
description_content = "# Release notes\n"
228+
description_content += f"## Features\n{get_pr_descriptions(enhancement_prs)}" if enhancement_prs else ""
229+
description_content += f"## Bug fixes\n{get_pr_descriptions(bug_fix_prs)}" if bug_fix_prs else ""
230+
231+
assignees = list(set(get_prs_assignees(enhancement_prs) + get_prs_assignees(bug_fix_prs)))
232+
assignees.sort(key=str.lower)
233+
234+
description_content += f"### Authors:\n{', '.join(assignees)}"
235+
236+
update_pull_request_description(
237+
github_token, repository_owner, repository_name, release_pr[0]["number"], description_content
238+
)
239+
240+
print(f"PR content updated to:\n{description_content}")

0 commit comments

Comments
 (0)