Skip to content

Commit

Permalink
Include F40FTBFS bugs in bugzilla report
Browse files Browse the repository at this point in the history
  • Loading branch information
befeleme committed Feb 7, 2024
1 parent 2ae898e commit 7f57e11
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def sort_by_maintainers(packages_with_maintainers, build_status):

def create_failed_report(build_status):
failure_report = {}
for pkg, bzurl in BUGZILLAS.items():
for pkg, bzurls in BUGZILLAS.items():
if (state := build_status.get(pkg)) is not None:
failure_report[pkg] = {"bzurl": bzurl, "state": state}
failure_report[pkg] = {"bzurls": bzurls, "state": state}
return failure_report


Expand Down
19 changes: 7 additions & 12 deletions scripts/bugzillas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
BUGZILLA = 'bugzilla.redhat.com'
BZ_PAGE_SIZE = 20
TRACKER = 2244836 # PYTHON3.13
RAWHIDE = 2231791 # F40FTBFS
BZAPI = bugzilla.Bugzilla(BUGZILLA)

FAILED = load_data("data/failed.pkgs")
Expand All @@ -16,11 +17,12 @@
# Attempt to find bugzillas for packages that
# started to fail to build just recently
FAILED.update(pkg for pkg in HISTORICALLY_SUCCESSFUL if ALL_IN_COPR.get(pkg) == "failed")
SORTED_FAILS = sorted(FAILED)


def bugzillas():
query = BZAPI.build_query(product='Fedora')
query['blocks'] = TRACKER
query['blocks'] = [TRACKER, RAWHIDE]
query['limit'] = BZ_PAGE_SIZE
query['offset'] = 0
results = []
Expand All @@ -29,20 +31,13 @@ def bugzillas():
query['offset'] += BZ_PAGE_SIZE
results += partial
return [b for b in sorted(results, key=lambda b: -b.id)
if b.resolution != 'DUPLICATE']


def bz_url(bugzillas, failed_pkg):
for bug in bugzillas:
if failed_pkg == bug.component and bug.is_open:
return bug.weburl
return None
if b.is_open and b.component in SORTED_FAILS]


def map_pkgs_and_bzurls(bugzillas):
pkgs_urls = {}
for failed_pkg in sorted(FAILED):
pkgs_urls[failed_pkg] = bz_url(bugzillas, failed_pkg)
pkgs_urls = {pkg: [] for pkg in SORTED_FAILS}
for bug in bugzillas:
pkgs_urls[bug.component].append(bug.weburl)
return pkgs_urls


Expand Down
14 changes: 11 additions & 3 deletions templates/failures.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<head>
<title>Fedora - Python 3.13 failed to build breakdown</title>
</head>
<style>
tr:hover {background-color: #daecec;}
</style>
<body>
<a href="{{ url_for('index') }}">Take me home</a><br>
<h2>Packages that fail to build (🔴 + 🟠)</h2>
Expand All @@ -11,15 +14,20 @@ <h2>Packages that fail to build (🔴 + 🟠)</h2>
<th>Package name</th>
<th>Build status</th>
<th>Build attempts in Copr</th>
<th>Bugzilla ticket</th>
<th>Bugzilla ticket (all open PYTHON3.13 and F40FTBFS)</th>
</tr>
{% for package_name, detail in status_failed.items() %}
<tr>
<td>{{ package_name }}</td>
<td>{{ detail["state"] }}</td>
<td><a href="https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/{{ package_name }}/">Copr - {{package_name}}</a></td>
{% if detail["bzurl"] %}
<td><a href={{ detail["bzurl"] }}>Bugzilla - {{package_name}}</a></td>
<td>
{% if detail["bzurls"] %}
{% for bzurl in detail["bzurls"] %}
<a href={{ bzurl }}>Bugzilla - {{package_name}}</a>
<br>
{% endfor %}
</td>
{% endif %}
</tr>
{% endfor %}
Expand Down

0 comments on commit 7f57e11

Please sign in to comment.