diff --git a/app.py b/app.py index dd22d60d..59e56231 100644 --- a/app.py +++ b/app.py @@ -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 diff --git a/scripts/bugzillas.py b/scripts/bugzillas.py index 50786b16..d2bb1e77 100644 --- a/scripts/bugzillas.py +++ b/scripts/bugzillas.py @@ -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") @@ -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 = [] @@ -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 diff --git a/templates/failures.html b/templates/failures.html index ff7b164c..07dc1589 100644 --- a/templates/failures.html +++ b/templates/failures.html @@ -2,6 +2,9 @@