-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfile_build_failures.py
75 lines (55 loc) · 2.12 KB
/
file_build_failures.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import bugzilla
import pathlib
import time
import sys
import webbrowser
from urllib.parse import urlencode
from textwrap import dedent
BUGZILLA = 'bugzilla.redhat.com'
TRACKER = 1686977 # PYTHON38
def bugzillas():
bzapi = bugzilla.Bugzilla(BUGZILLA)
query = bzapi.build_query(product='Fedora')
query['blocks'] = TRACKER
return sorted(bzapi.query(query), key=lambda b: -b.id)
def bug(bugs, package):
for b in bugs:
if b.component == package:
return b
return None
def open_bz(package):
summary = f"{package} fails to build with Python 3.8 on Fedora 32+"
description = dedent(f"""
{package} fails to build with Python 3.8.0b4 in Fedora 32.
See the build failures at https://koji.fedoraproject.org/koji/search?match=glob&type=package&terms={package}
...
It is not important whether the problem is relevant to Python 3.8, this issue is blocking the Python 3.8 rebuilds.
If this package won't build with 3.8, it won't be installable, along with all its dependent packages, in Fedora 32 and further.
Furthermore, as it fails to install, its dependent packages will fail to install and/or build as well.
Please rebuild the package in Fedora 32 (rawhide).
Let us know here if you have any questions. Thank You!
""")
url_prefix = 'https://bugzilla.redhat.com/enter_bug.cgi?'
params = {
'short_desc': summary,
'comment': description,
'component': package,
'blocked': 'PYTHON38,F32FTBFS,F32FailsToInstall',
'product': 'Fedora',
'version': 'rawhide',
'bug_severity': 'high',
}
webbrowser.open(url_prefix + urlencode(params))
time.sleep(1)
webbrowser.open(f'https://koji.fedoraproject.org/koji/search?match=glob&type=package&terms={package}')
time.sleep(1)
pkgs = pathlib.Path(sys.argv[1]).read_text().splitlines()
print('Getting bugzillas...', end=' ', flush=True)
bugs = bugzillas()
print('..done.')
for pkg in pkgs:
bz = bug(bugs, pkg)
if bz:
print(f'{pkg} bz{bz.id} {bz.status}')
if not bz or bz.status == 'CLOSED':
open_bz(pkg)