fedora-infra / fedora-packages

A webapp that allows searching packages in Fedora. Written in Python using TurboGears2 and Moksha.
https://apps.fedoraproject.org/packages
GNU Affero General Public License v3.0
58 stars 59 forks source link

Use bugzilla's new __open__ status query to avoid inconsistent results #417

Closed ferdnyc closed 5 years ago

ferdnyc commented 5 years ago

The query string used to access bugzilla's list of open bugs for a given package is hardcoded at several different places in the code, many of them inconsistent. Some included bug_status=MODIFIED, some didn't. Some included bug_status=REOPENED, which is no longer a supported status. Nearly all were missing at least one valid open statuses.

This led to inconsistent and confusing results, such as a package being listed as having "Open bugs: 1" yet linking to an empty bug list. (The query for the open bug count included bug_status=POST. The URL for the list did not.)

The upgraded Bugzilla 5 instance now in use at bugzilla.redhat.com supports the status metatypes __open__ and __closed__ as shortcuts for "all open" and "all closed" bug statuses (respectively), eliminating the need to manage externally-hardcoded lists of matching status types.

This change replaces all hardcoded lists of open bug_status types with simply bug_status=__open__, for consistency. (The one location where bug_status=CLOSED is queried is also changed to bug_status=__closed__ as a bit of future-proofing, though at present the two are equivalent.)

The bug_sort() method of the bugzilla connector is also updated, to order bugs by a set of statuses which matches the current supported list of open statuses. (As a comment there already notes, any bugs having a status not present in the hardcoded list will simply be sorted to the end.)

cverna commented 5 years ago

Thanks looks good :+1: